using MicroMsg.Protocol;
using MicroMsg.Storage;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.Windows.Media.Imaging;
namespace MicroMsg.Plugin
{
	public abstract class PluginBase
	{
		private const string TAG = "PluginBase";
		public string mKey;
		public long mID;
		public string mName;
		public string mUserName;
		public int mVersion;
		public MainTabIndex mIndexInTab;
		public int mIndexInGroup;
		public int mIndexInPosition;
		public bool mDefaultInstalled = true;
		public bool mEnabled = true;
		public EPluginFlag mProtocolPluginFlag;
		public PluginMetaInfo mMetaInfo = new PluginMetaInfo();
		protected StandardUITaskDlg mFFEntryCallBack;
		public abstract string mTitle
		{
			get;
		}
		public virtual string mFFEntryTitle
		{
			get;
			set;
		}
		public abstract BitmapSource mIcon
		{
			get;
		}
		public abstract BitmapSource mIconHD
		{
			get;
		}
		public abstract BitmapSource mIconInList
		{
			get;
		}
		public BitmapSource mIconInFFEntry
		{
			get;
			set;
		}
		public BitmapSource mIconFlagInFFEntry
		{
			get;
			set;
		}
		public abstract string mDescription
		{
			get;
		}
		public abstract string mAuthor
		{
			get;
		}
		public abstract PluginSettingBaseCtrl GetPluginSettingCtrl();
		public static bool isValidPlugin(PluginBase plugin)
		{
			return plugin != null && plugin.isValidPlugin();
		}
		public bool isValidPlugin()
		{
			return this.mMetaInfo.isRegistered;
		}
		public bool isInTab(MainTabIndex index)
		{
			return (this.mIndexInTab & index) != (MainTabIndex)0;
		}
		public static bool isInstalledPlugin(PluginBase plugin)
		{
			return plugin != null && plugin.isInstalledPlugin();
		}
		public bool isInstalledPlugin()
		{
			return this.mMetaInfo.isRegistered && this.mMetaInfo.isInstalled;
		}
		public virtual void onRegisterResult(RetConst retConst_0, int code)
		{
		}
		public virtual void onUnRegisterResult(RetConst retConst_0, int code)
		{
		}
		public virtual bool onInitialize()
		{
			return true;
		}
		public virtual bool isShowFlagImage()
		{
			return false;
		}
		public virtual bool onUnInitialize()
		{
			this.mFFEntryCallBack = null;
			return true;
		}
		public virtual bool onInstalled(InstallMode mode)
		{
			return true;
		}
		public virtual bool onUninstalled(InstallMode mode)
		{
			this.mFFEntryCallBack = null;
			return true;
		}
		public virtual void onAppActivated()
		{
		}
		public virtual void onAppDeactivated()
		{
		}
		public virtual bool onParseChatMsg(ChatMsg chatMsg)
		{
			return false;
		}
		public virtual bool onParseChatTalker(string talker)
		{
			return false;
		}
		public abstract object execute(int entryType, object args);
		public virtual void SetFFEntryCallBack(StandardUITaskDlg FFEntryCallBack)
		{
		}
		public virtual void ClearFFEntryCallBack()
		{
			this.mFFEntryCallBack = null;
		}
		public virtual void OnShowInFFEntry()
		{
		}
	}
}
